public class Student {
    public String name;
    public int age;

    public static String classes="106Java2班";//班级  静态成员变量-》类变量  访问：  类名.去访问

    {
        name = "lisi";

        System.out.println("实例代码块！");
    }

    static {
        classes = "106Java1班";
        //类加载的时候 就被执行
        System.out.println("静态代码块！");
    }

    static {

    }

    public Student() {
        //调用本类当中 其他的构造方法
        //this("wangwu",99);//必须放在构造方法里面，并且必须是第一行
        System.out.println("不带参数的构造方法");
    }

    public Student(String name,int age) {
        //this(); 不能循环调用
        System.out.println("带2个参数的构造方法");
        this.name = name;
        this.age = age;
    }

    private void setStudent(String name,int age) {
        this.name = name;
        this.age = age;
    }

    public void print() {
        System.out.println(this.name+" => "+this.age+"->"+Student.classes);
    }

    public static void func2() {
        //this.print();
    }

    public static void main(String[] args) {
        Student student1 = new Student();
        System.out.println("===========");
        Student student2 = new Student();

        System.out.println(Student.classes);

        {

        }

    }


    public static void main3(String[] args) {
        Student.classes = "106Java";
        Student.func2();
        Student student1 = new Student("zhangsan1",12);
        student1.print();
    }





    public static void main2(String[] args) {
        Student student1 = new Student("zhangsan1",12);

        Student student2 = new Student("zhangsan2",22);

        Student student3 = new Student("zhangsan3",82);

        Student.classes = "106Java";

        student1.print();
        student2.print();
        student3.print();

    }

    public static void main1(String[] args) {
        Student student = new Student();
        System.out.println("88888");
        //Student student2 = new Student("张三",18);
        //System.out.println(student.name);
        //student.setStudent("bit",12);
        //student.print();
    }
}